libvchan: fix segfault in client error path
authorAnil Madhavapeddy <anil@recoil.org>
Thu, 24 Nov 2011 19:09:55 +0000 (19:09 +0000)
committerAnil Madhavapeddy <anil@recoil.org>
Thu, 24 Nov 2011 19:09:55 +0000 (19:09 +0000)
In libvchan_client_init, go to the error path if the gntdev device is
not available.  Otherwise, a segfault happens later as the vchan
context is invalid.

Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libvchan/init.c

index becf71d2ab3e6be1567b8ab94c67c06da8ee92fa..acaddd5b041d7c4c0ed801d6ab3fd423d79e2625 100644 (file)
@@ -385,7 +385,7 @@ struct libxenvchan *libxenvchan_client_init(xentoollog_logger *logger, int domai
 
        ctrl->gnttab = xc_gnttab_open(logger, 0);
        if (!ctrl->gnttab)
-               goto out;
+               goto fail;
 
 // set up event channel
        if (init_evt_cli(ctrl, domain, logger))